home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************
-
- File: ResourceUtils.h
-
- Copyright © 1996, 1997, 1998 Apple Computer, Inc., All Rights Reserved
-
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- *************************************************************************************/
-
- #ifndef __RESOURCEUTILS__
- #define __RESOURCEUTILS__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __ICONS__
- #include <Icons.h>
- #endif
-
- void Resource_GetIndString(short inResourceId, UInt32 inIndex, SInt16 inDestSize, StringPtr outString, OSStatus *error);
- void Resource_GetString(short inResourceId, SInt16 inDestSize, StringPtr outString, OSStatus *error);
-
- /*
- * Resource_Copy
- *
- * copies a resource from one resource file to another
- * in the process it releases the original resource.
- *
- */
-
- void Resource_Copy(short inFromRef, short inFromID, ResType inType, short inToRef, short inToID, OSStatus *error);
-
- /*
- *
- * Resource_Get1IconSuite
- *
- * Gets a icon suite from the current resource file
- *
- * In the process it detaches and makes all the handle non purgable.
- *
- */
-
- Handle Resource_Get1IconSuite(short inResourceId, IconSelectorValue inSelector, OSStatus *error);
-
- /*
- *
- * Resource_CleanResHandle
- *
- * takes a resource handle, detaches it and makes it non purgable
- * assumes that this is a valid resource handle whose resChange bit
- * is not set
- *
- */
-
- void Resource_CleanResHandle(Handle inResourceHandle);
-
- /*
- *
- * Resource_Delete1
- *
- *
- * delete a resource by id and type
- *
- */
-
- void Resource_Delete1(ResType inType, short inID, OSStatus *err);
-
-
-
- class StCurResFileState {
- public:
- StCurResFileState(void);
- StCurResFileState(short inNewCurResFile); // sets the cur res file to inNewPort
-
- ~StCurResFileState(void);
-
- void Save();
- void Restore();
-
- private:
- short mResFileRefNum;
- };
-
-
- #endif // __RESOURCEUTILS__